﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/Visitor.master" AutoEventWireup="true" CodeFile="CalculateCharge.aspx.cs" Inherits="Visitor_CalculateCharge" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">


            <div id="head">
            <asp:Label ID="Label1" runat="server" ForeColor="White" Text="Calculate Charge" 
                    Font-Bold="True" Font-Size="Small" ></asp:Label>
            </div>

                
<table class="style3" align="center" >
     
    <tr>
        <td class="style6" style="width: 12%">
                &nbsp;</td>
        <td class="style4" style="width: 152px">
            Select a type of deliver</td>
        <td>
            <asp:DropDownList ID="ddlDType" runat="server" 
                DataSourceID="SqlDataSource1" DataTextField="DTypeName" 
                DataValueField="DTypeCharge" Width="170px">
            </asp:DropDownList>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                ConnectionString="<%$ ConnectionStrings:OPOConnectionString %>" 
                
                SelectCommand="SELECT [DTypeID], [DTypeName], [DTypeCharge] FROM [TypeofDeliver]"></asp:SqlDataSource>
        </td>
    </tr>
    <tr>
        <td class="style6" style="width: 12%">
            &nbsp;</td>
        <td class="style4" style="width: 152px">
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
        <tr>
        <td class="style6" style="width: 12%">
                &nbsp;</td>
        <td class="style4" style="width: 152px">
            Select an item</td>
        <td>
            <asp:DropDownList ID="ddlMType" runat="server" 
                DataSourceID="SqlDataSource3" DataTextField="MTypeName" 
                DataValueField="MTypeID" Width="170px" >
            </asp:DropDownList>
            <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
                ConnectionString="<%$ ConnectionStrings:OPOConnectionString %>" 
                SelectCommand="SELECT [MTypeID], [MTypeName] FROM [TypeofMail]"></asp:SqlDataSource>
        </td>
        </tr>
        <tr>
        <td class="style6" style="width: 12%">
                &nbsp;</td>
        <td class="style4" style="width: 152px">
            &nbsp;</td>
        <td>
            &nbsp;</td>
        </tr>
        <tr>
        <td class="style6" style="width: 12%">
                &nbsp;</td>
        <td class="style4" style="width: 152px">
            Enter weight</td>
        <td class="style8">
            <asp:TextBox ID="txtWeight" runat="server" Width="170px"></asp:TextBox>
            &nbsp; grams<br />
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                ControlToValidate="txtWeight" ErrorMessage="Please enter weight" 
                Font-Size="Small" ForeColor="Red"></asp:RequiredFieldValidator>
            <br />
            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                ControlToValidate="txtWeight" ErrorMessage="Weight contains digits only" 
                Font-Size="Small" ForeColor="Red" 
                ValidationExpression="^[.][0-9]+$|[0-9]*[.]*[0-9]+$"></asp:RegularExpressionValidator>
            </td>
        </tr>
    <tr>
        <td class="style6" style="width: 12%">
            &nbsp;</td>
        <td class="style4" style="width: 152px">
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
        <tr>
        <td class="style6" style="width: 12%">
            &nbsp;</td>
        <td class="style4" style="width: 152px">
            Select an Distance</td>
        <td>
            <asp:DropDownList ID="ddlDistance" runat="server" 
                DataSourceID="SqlDataSource2" DataTextField="Distance" 
                DataValueField="DistanceCharge" Width="170px">
            </asp:DropDownList>
            <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
                ConnectionString="<%$ ConnectionStrings:OPOConnectionString %>" 
                SelectCommand="SELECT * FROM [DistanceofMail]"></asp:SqlDataSource>
        </td>
        </tr>
    <tr>
        <td class="style6" style="width: 12%">
                &nbsp;</td>
        <td class="style4" style="width: 152px">
                &nbsp;</td>
        <td>
                &nbsp;</td>
    </tr>
    <tr>
        <td class="style6" style="width: 12%">
                &nbsp;</td>
        <td class="style6" style="width: 152px">
            <asp:ImageButton ID="imgbCheck" runat="server" 
                ImageUrl="~/images/btnCheck.png" onclick="imgbCheck_Click" Height="26px" />
        </td>
        <td>
            <asp:ImageButton ID="imgbReset" runat="server" 
                ImageUrl="~/images/btnReset.png" CausesValidation="False" 
                onclick="imgbReset_Click" />
        </td>
    </tr>
    <tr>
        <td class="style6" style="width: 12%">
                &nbsp;</td>
        <td class="style7" style="width: 152px">
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    </table>
</asp:Content>

